﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using VoiceMessager.Properties;

namespace VoiceMessager.Converter
{
    public class VerifyStateConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value!=null)
            {
                var x = bool.Parse(value.ToString());
                return x ? Resources.shield_ok.ToBitmapImage() : Resources.shield_error.ToBitmapImage();
            }
            return Resources.sign_error.ToBitmapImage();
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
